[jQuery] How to load vtip tooltip on a dynamically generated element?

Posted by adaneko on Stack Overflow See other posts from Stack Overflow or by adaneko
Published on 2010-04-04T06:46:13Z Indexed on 2010/04/04 6:53 UTC
Read the original article Hit count: 188

Filed under:

I'm new to jQuery and trying to combine the use of a tooltip plugin and a lightbox plugin. More specifically, I am using Colorbox (http://colorpowered.com/colorbox/) and vtip.

Colorbox generates a div which displays an image like this:

<div id="cboxLoadedContent" style="display: block; width: 400px; overflow: auto; height: 498px;">
<img src="image.jpg" id="cboxPhoto" style="margin: 49px auto auto; border: medium none; display: block; float: none; cursor: pointer;">
</div>

I next add class="vtip" title="This is a tip." in order to use the vtip style, but for some reason it does not work when it's a title tag on an element dynamically generated by Colorbox, but works on anything already loaded on the page.

Can anyone explain to me why this is and possibly offer some solutions to fix this problem?

© Stack Overflow or respective owner

Related posts about jquery-plugins